
*drop _all

* first import the data set

************************************************************** 

* CE1: R
* CE2: CR25
* CE3: CR0
* CE4: MA25
* CE5: MA0
* CE9: E

**************************************************************

* Certainty equivalents 

generate double CE_R=CE1
generate double CE_CR25=CE2
generate double CE_CR0=CE3
generate double CE_MA25=CE4
generate double CE_MA0=CE5
generate double CE_E=CE9 

* Premia relative to simple risk - As defined in the main text

generate double P_CR25=(CE1-CE2)/max(CE1, CE2)
generate double P_CR0=(CE1-CE3)/max(CE1, CE3)
generate double P_MA25=(CE1-CE4)/max(CE1, CE4)
generate double P_MA0=(CE1-CE5)/max(CE1, CE5)
generate double P_E=(CE1-CE9)/max(CE1, CE9)

* generate variables for education, experience, age and income

tabulate Degree

* High School or 2-year college
replace Degree=1 if Degree==4 | Degree==2
* Bachelor's
replace Degree=2 if Degree==5
* Master's
replace Degree=3 if Degree==6
* PhD's
replace Degree=4 if Degree==7

generate Higher_than_Bach=0 
replace Higher_than_Bach=1 if Degree>1

generate High_Experience=0
replace High_Experience=1 if experience>10

generate older=0
replace older=1 if Age>38

generate High_Income=0
replace High_Income=1 if Income>1 & Actuaries==0
replace High_Income=1 if Income>6 & Actuaries==1

***************************************************************

***************** Notes for replicators ***********************

* For reproducing Table A.1, run lines 104-139

* For reproducing Table A.2, run lines 140-181

* For reproducing Table A.3, run lines 181-217

* For reproducing Table A.4, run lines 218-278

* For reproducing Table A.5, run lines 279-288

* For reproducing Table A.6, run lines 289-300

* For reproducing Table A.7, run lines 301-331

* For reproducing Table A.8, run lines 332-357

* For reproducing Table A.9, run lines 358-404

* For reproducing Figure A.3, run lines 405-414

* For reproducing Figure A.4, run lines 415-423

* For reproducing Figure A.5, run lines 424-432

* For reproducing Table A.10, run lines 433-484

* For reproducing Table A.11, run lines 485-522

* For reproducing Table A.12, run lines 523-539

* For reproducing Table A.13, run lines 540-584

* For reproducing Table A.14, run lines 585-621

* For reproducing Table A.15, run lines 622-638

* For reproducing Table A.16, run lines 639-684

* For reproducing Table A.17, run lines 684-722



*******************************************************
* Table A.1: Average Premia Relative to Risk 
*******************************************************

* Define the alternative premia by division by risk certainty equivalent

generate double P_CR25_alt1=(CE1-CE2)/CE1
generate double P_CR0_alt1=(CE1-CE3)/CE1
generate double P_MA25_alt1=(CE1-CE4)/CE1
generate double P_MA0_alt1=(CE1-CE5)/CE1
generate double P_E_alt1=(CE1-CE9)/CE1

* Actuaries
ttest P_CR0_alt1=0 if Actuaries==1
ttest P_CR25_alt1=0 if Actuaries==1
ttest P_MA0_alt1=0 if Actuaries==1
ttest P_MA25_alt1=0 if Actuaries==1
ttest P_E_alt1=0 if Actuaries==1

* Students
ttest P_CR0_alt1=0 if Actuaries==0
ttest P_CR25_alt1=0 if Actuaries==0
ttest P_MA0_alt1=0 if Actuaries==0
ttest P_MA25_alt1=0 if Actuaries==0
ttest P_E_alt1=0 if Actuaries==0

* Two-sample tests
ttest P_CR0_alt1, by(Actuaries)
ttest P_CR25_alt1, by(Actuaries)
ttest P_MA0_alt1, by(Actuaries)
ttest P_MA25_alt1, by(Actuaries)
ttest P_E_alt1, by(Actuaries)




*******************************************************
* Table A.2: Average Premia Relative to Risk 
*******************************************************

* Define the alternative premia by division by expected value

generate double P_CR25_alt2=(CE1-CE2)/10
replace P_CR25_alt2=P_CR25_alt2/10 if Actuaries==1
generate double P_CR0_alt2=(CE1-CE3)/10
replace P_CR0_alt2=P_CR0_alt2/10 if Actuaries==1
generate double P_MA25_alt2=(CE1-CE4)/10
replace P_MA25_alt2=P_MA25_alt2/10 if Actuaries==1
generate double P_MA0_alt2=(CE1-CE5)/10
replace P_MA0_alt2=P_MA0_alt2/10 if Actuaries==1
generate double P_E_alt2=(CE1-CE9)/10
replace P_E_alt2=P_E_alt2/10 if Actuaries==1

* Actuaries
ttest P_CR0_alt2=0 if Actuaries==1
ttest P_CR25_alt2=0 if Actuaries==1
ttest P_MA0_alt2=0 if Actuaries==1
ttest P_MA25_alt2=0 if Actuaries==1
ttest P_E_alt2=0 if Actuaries==1

* Students
ttest P_CR0_alt2=0 if Actuaries==0
ttest P_CR25_alt2=0 if Actuaries==0
ttest P_MA0_alt2=0 if Actuaries==0
ttest P_MA25_alt2=0 if Actuaries==0
ttest P_E_alt2=0 if Actuaries==0

* Two-sample tests
ttest P_CR0_alt2, by(Actuaries)
ttest P_CR25_alt2, by(Actuaries)
ttest P_MA0_alt2, by(Actuaries)
ttest P_MA25_alt2, by(Actuaries)
ttest P_E_alt2, by(Actuaries)




*******************************************************
* Table A.3: Average Premia Relative to Risk 
*******************************************************

* Define the alternative premia by division by risk certainty equivalent

generate double P_CR25_alt3=(CE1-CE2)/(CE1+CE2)
generate double P_CR0_alt3=(CE1-CE3)/(CE1+CE3)
generate double P_MA25_alt3=(CE1-CE4)/(CE1+CE4)
generate double P_MA0_alt3=(CE1-CE5)/(CE1+CE5)
generate double P_E_alt3=(CE1-CE9)/(CE1+CE9)

* Actuaries
ttest P_CR0_alt3=0 if Actuaries==1
ttest P_CR25_alt3=0 if Actuaries==1
ttest P_MA0_alt3=0 if Actuaries==1
ttest P_MA25_alt3=0 if Actuaries==1
ttest P_E_alt3=0 if Actuaries==1

* Students
ttest P_CR0_alt3=0 if Actuaries==0
ttest P_CR25_alt3=0 if Actuaries==0
ttest P_MA0_alt3=0 if Actuaries==0
ttest P_MA25_alt3=0 if Actuaries==0
ttest P_E_alt3=0 if Actuaries==0

* Two-sample tests
ttest P_CR0_alt3, by(Actuaries)
ttest P_CR25_alt3, by(Actuaries)
ttest P_MA0_alt3, by(Actuaries)
ttest P_MA25_alt3, by(Actuaries)
ttest P_E_alt3, by(Actuaries)





**************************************************************
* Table A4. Variation in the CEs as a function of the order of scenarios
**************************************************************

* Part I: Actuaries

* For R
sort order_R
by order_R: summarize CE1 if Actuaries==1
oneway CE1 order_R if Actuaries==1

* For CR0
sort order_CR0
by order_CR0: summarize CE3 if Actuaries==1
oneway CE3 order_CR0 if Actuaries==1

* For CR25
sort order_CR25
by order_CR25: summarize CE2 if Actuaries==1
oneway CE2 order_CR25 if Actuaries==1

* For MA0
sort order_MA0
by order_MA0: summarize CE5 if Actuaries==1
oneway CE5 order_MA0 if Actuaries==1

* For MA25
sort order_MA25
by order_MA25: summarize CE4 if Actuaries==1
oneway CE4 order_MA25 if Actuaries==1

* Part II: Students

* For R
sort order_R
by order_R: summarize CE1 if Actuaries==0
oneway CE1 order_R if Actuaries==0

* For CR0
sort order_CR0
by order_CR0: summarize CE3 if Actuaries==0
oneway CE3 order_CR0 if Actuaries==0

* For CR25
sort order_CR25
by order_CR25: summarize CE2 if Actuaries==0
oneway CE2 order_CR25 if Actuaries==0

* For MA0
sort order_MA0
by order_MA0: summarize CE5 if Actuaries==0
oneway CE5 order_MA0 if Actuaries==0

* For MA25
sort order_MA25
by order_MA25: summarize CE4 if Actuaries==0
oneway CE4 order_MA25 if Actuaries==0




*******************************************************
* Table A.5: Descriptive Statistics of the CEs
*******************************************************

summarize CE_R CE_CR0 CE_CR25 CE_MA0 CE_MA25 CE_E if Actuaries==1
summarize CE_R CE_CR0 CE_CR25 CE_MA0 CE_MA25 CE_E if Actuaries==0




*******************************************************
* Table A.6: Descriptive Statistics of the Relative Compound Risk
* and Ambiguity Premia
*******************************************************

summarize P_CR0 P_CR25 P_MA0 P_MA25 P_E if Actuaries==1
summarize P_CR0 P_CR25 P_MA0 P_MA25 P_E if Actuaries==0





*******************************************************
* Table A.7: Spearman Correlations Between Compound Risk and Ambiguity Premia
*******************************************************

*** Actuaries

* Correlation of CR0 with ambiguous sources
spearman P_CR0 P_MA0 if Actuaries==1
spearman P_CR0 P_MA25 if Actuaries==1
spearman P_CR0 P_E if Actuaries==1

* Correlation of CR25 with ambiguous sources
spearman P_CR25 P_MA0 if Actuaries==1
spearman P_CR25 P_MA25 if Actuaries==1
spearman P_CR25 P_E if Actuaries==1

*** Students

* Correlation of CR0 with ambiguous sources
spearman P_CR0 P_MA0 if Actuaries==0
spearman P_CR0 P_MA25 if Actuaries==0
spearman P_CR0 P_E if Actuaries==0

* Correlation of CR25 with ambiguous sources
spearman P_CR25 P_MA0 if Actuaries==0
spearman P_CR25 P_MA25 if Actuaries==0
spearman P_CR25 P_E if Actuaries==0





*******************************************************
* Table A.8: Relation Between Compound Risk and Ambiguity Attitudes
*******************************************************

* generate cr-reduction variable
generate double Reduction=0
replace Reduction=1 if (P_CR0==0 & P_CR25==0) | (P_CR0==0 & P_CR25==.) | (P_CR0==. & P_CR25==0)
replace Reduction=. if (P_CR0==. & P_CR25==.)

* generate ambiguity neutrality variable
generate double AN=0
replace AN=1 if (P_MA0==0 & P_MA25==0 & P_E==0) | (P_MA0==. & P_MA25==0 & P_E==0) | (P_MA0==0 & P_MA25==. & P_E==0) | (P_MA0==0 & P_MA25==0 & P_E==.) | (P_MA0==. & P_MA25==. & P_E==0) | (P_MA0==. & P_MA25==0 & P_E==.) | (P_MA0==0 & P_MA25==. & P_E==.)
replace AN=. if (P_MA0==. & P_MA25==. & P_E==.)

* actuaries
tabulate Reduction AN if Actuaries==1, chi2 lrchi2 exact cell expected

* students
tabulate Reduction AN if Actuaries==0, chi2 lrchi2 exact cell expected

drop Reduction




*******************************************************
* Table A.9-I: Relation Between Compound Risk and E-Ambiguity Attitudes
*******************************************************

* generate cr-reduction variable
generate double Reduction=0
replace Reduction=1 if (P_CR0==0 & P_CR25==0) | (P_CR0==0 & P_CR25==.) | (P_CR0==. & P_CR25==0)
replace Reduction=. if (P_CR0==. & P_CR25==.)

* generate Ellsberg ambiguity neutrality variable
generate double E_AN=0
replace E_AN=1 if (P_E==0) 
replace E_AN=. if (P_E==.)

* actuaries
tabulate Reduction E_AN if Actuaries==1, chi2 lrchi2 exact cell expected

* students
tabulate Reduction E_AN if Actuaries==0, chi2 lrchi2 exact cell expected

drop Reduction


*******************************************************
* Table A.9-II: Relation Between Compound Risk and Model Ambiguity Attitudes
*******************************************************

* generate cr-reduction variable
generate double Reduction=0
replace Reduction=1 if (P_CR0==0 & P_CR25==0) | (P_CR0==0 & P_CR25==.) | (P_CR0==. & P_CR25==0)
replace Reduction=. if (P_CR0==. & P_CR25==.)

* generate model ambiguity neutrality variable
generate double M_AN=0
replace M_AN=1 if (P_MA0==0 & P_MA25==0) | (P_MA0==. & P_MA25==0) | (P_MA0==0 & P_MA25==.)
replace M_AN=. if (P_MA0==. & P_MA25==.)

* actuaries
tabulate Reduction M_AN if Actuaries==1, chi2 lrchi2 exact cell expected
* students
tabulate Reduction M_AN if Actuaries==0, chi2 lrchi2 exact cell expected

drop Reduction




************************************************
* Figure A.3 Distribution of Income
************************************************

twoway (hist Age if Actuaries==1, discrete color(red%100)) (hist Age if Actuaries==0, discrete color(white%0) lcolor(black%100)), legend(order(1 "Actuaries" 2 "Students"))   





************************************************
* Figure A.4 Distribution of Income
************************************************

twoway (hist Income if Actuaries==1, discrete color(red%100)) (hist Income if Actuaries==0, discrete color(white%0) lcolor(black%100)), legend(order(1 "Actuaries" 2 "Students"))     




************************************************
* Figure A.5 Distribution of highest Level of Education Completed
************************************************

twoway (hist Degree if Actuaries==1, discrete color(red%100)) (hist Degree if Actuaries==0, discrete color(white%0) lcolor(black%100)), legend(order(1 "Actuaries" 2 "Students"))    




*******************************************************
* Table A.10: Relation Between Compound Risk and Model Ambiguity Attitudes
*******************************************************

* Prepare the data for the long form

generate double P1=P_CR25
generate double P2=P_CR0
generate double P3=P_MA25
generate double P4=P_MA0

* reshape the data into long
reshape long P, i(ID) j(Source)

generate double Soph=Actuaries

generate COMPLEX=.
replace COMPLEX=0 if Source==2 | Source==4
replace COMPLEX=1 if Source==1 | Source==3

generate AMBIGOUS=.
replace AMBIGOUS=0 if Source==1 | Source==2
replace AMBIGOUS=1 if Source==3 | Source==4

generate Gender=0
replace Gender=1 if GenderM1F2==2

* Regression for actuaries
xtreg  P i.COMPLEX##i.AMBIGOUS Age Gender High_Income Higher_than_Bach if Actuaries==1, vce(cluster ID) i(ID) re 
estimates store Actuaries

* Regression for students
xtreg  P i.COMPLEX##i.AMBIGOUS Age Gender High_Income Higher_than_Bach if Actuaries==0, vce(cluster ID) i(ID) re 
estimates store Students

* Regression for testing differences between groups
xtreg  P COMPLEX##AMBIGOUS##Soph Age Gender High_Income Higher_than_Bach, vce(cluster ID) i(ID) re
estimates store Pooled

* Reconstruct Table A.10
esttab Actuaries Students Pooled, mti se scalars(N R2) label

* reshape the data into wide form
drop COMPLEX AMBIGOUS Soph
drop _est_Actuaries _est_Students _est_Pooled

reshape wide P, i(ID) j(Source)
drop P1 P2 P3 P4




*******************************************************
* Table A.11: Relation Between Compound Risk and Model Ambiguity Attitudes
*******************************************************

* Define model uncertainty attitude
generate double MU_A=P_MA0-P_CR0

* Define complexity attitude
generate double c_A=P_CR25-P_CR0

* Define reduction
generate double red=0
replace red=1 if P_CR0!=0
replace red=. if P_CR0==.

* dummy for sophistication
generate double Soph=Actuaries

* regression for actuaries
regress P_E c_A MU_A red Age Gender High_Income Higher_than_Bach if Actuaries==1, vce(robust)
estimates store Actuaries

* regression for students
regress P_E  c_A MU_A red Age Gender High_Income Higher_than_Bach if Actuaries==0, vce(robust)
estimates store Students

* regression to test differences between groups
regress P_E i.Soph##c.c_A i.Soph##c.MU_A i.Soph##i.red Age Gender High_Income Higher_than_Bach, vce(robust) 
estimates store Pooled

* reconstruct the Table A.11
esttab Actuaries Students Pooled, mti se scalars(N R2) label

drop MU_A c_A red Soph




*******************************************************
* Table A12: Pearson Correlations Within Actuaries
*******************************************************

* older risk professionals

pwcorr P_CR0 P_MA0 P_MA25 P_E if Actuaries==1 & older==1, sig
pwcorr P_CR25 P_MA0 P_MA25 P_E if Actuaries==1 & older==1, sig

* younger risk professionals

pwcorr P_CR0 P_MA0 P_MA25 P_E if Actuaries==1 & older==0, sig
pwcorr P_CR25 P_MA0 P_MA25 P_E if Actuaries==1 & older==0, sig




*******************************************************
* Table A13: Random Effects Regressions of Relative Premia, Actuaries
*******************************************************

* Prepare the data for the long form

generate double P1=P_CR25
generate double P2=P_CR0
generate double P3=P_MA25
generate double P4=P_MA0

* reshape the data into long form
reshape long P, i(ID) j(Source)

generate COMPLEX=.
replace COMPLEX=0 if Source==2 | Source==4
replace COMPLEX=1 if Source==1 | Source==3

generate AMBIGOUS=.
replace AMBIGOUS=0 if Source==1 | Source==2
replace AMBIGOUS=1 if Source==3 | Source==4

* regression for older actuaries
xtreg  P i.COMPLEX##i.AMBIGOUS if Actuaries==1 & older==1, vce(cluster ID) i(ID) re 
estimates store older

* regression for younger actuaries
xtreg  P i.COMPLEX##i.AMBIGOUS if Actuaries==1 & older==0, vce(cluster ID) i(ID) re 
estimates store younger

* regression for testing differences between young and old actuaries
xtreg  P COMPLEX##AMBIGOUS##older if Actuaries==1, cluster(ID) i(ID) re
estimates store pooled

esttab older younger pooled, mti se scalars(N R2) label star(ms 0.1 * 0.05 ** 0.01 *** 0.001)

* reshape the data into wide form
drop COMPLEX AMBIGOUS 
drop _est_older _est_younger _est_pooled
reshape wide P, i(ID) j(Source)
drop P1 P2 P3 P4




*******************************************************
* Table A14: OLS Regressions of Ellsberg Ambiguity Premium, Actuaries
*******************************************************

* Define model uncertainty attitude
generate double MU_A=P_MA0-P_CR0

* Define complexity attitude
generate double c_A=P_CR25-P_CR0

* Define reduction
generate double red=0
replace red=1 if P_CR0!=0
replace red=. if P_CR0==.

* dummy for sophistication
generate double Soph=Actuaries

* regression for older actuaries
regress P_E c_A MU_A red  if Actuaries==1 & older==1, vce(robust)
estimates store older

* regression for younger actuaries
regress P_E  c_A MU_A red  if Actuaries==1 & older==0, vce(robust)
estimates store younger

* regression for testing differences between young and old actuaries
regress P_E i.older##c.c_A i.older##c.MU_A i.older##i.red if Actuaries==1, vce(robust) 
estimates store pooled

esttab older younger pooled, mti se scalars(N R2) label star(ms 0.1 * 0.05 ** 0.01 *** 0.001)

drop MU_A c_A red Soph




*******************************************************
* Table A15: Pearson Correlations Within Students
*******************************************************

* Master's and PhD

pwcorr P_CR0 P_MA0 P_MA25 P_E if Actuaries==0 & Higher_than_Bach==1, sig
pwcorr P_CR25 P_MA0 P_MA25 P_E if Actuaries==0 & Higher_than_Bach==1, sig

* Bachelor's

pwcorr P_CR0 P_MA0 P_MA25 P_E if Actuaries==0 & Higher_than_Bach==0, sig
pwcorr P_CR25 P_MA0 P_MA25 P_E if Actuaries==0 & Higher_than_Bach==0, sig




*******************************************************
* Table A16: Random Effects Regressions of Relative Premia, Students
*******************************************************

* Prepare the data for the long form

generate double P1=P_CR25
generate double P2=P_CR0
generate double P3=P_MA25
generate double P4=P_MA0

* Reshape the data into long
reshape long P, i(ID) j(Source)

generate COMPLEX=.
replace COMPLEX=0 if Source==2 | Source==4
replace COMPLEX=1 if Source==1 | Source==3

generate AMBIGOUS=.
replace AMBIGOUS=0 if Source==1 | Source==2
replace AMBIGOUS=1 if Source==3 | Source==4

* regression for Master's and PhD's
xtreg  P i.COMPLEX##i.AMBIGOUS if Actuaries==0 & Higher_than_Bach==1, vce(cluster ID) i(ID) re 
estimates store MAorPhD

* regression for Bachelors'
xtreg  P i.COMPLEX##i.AMBIGOUS if Actuaries==0 & Higher_than_Bach==0, vce(cluster ID) i(ID) re 
estimates store BA

* regression for comparing two groups of students
xtreg  P COMPLEX##AMBIGOUS##Higher_than_Bach if Actuaries==0, cluster(ID) i(ID) re
estimates store pooled

* reconstruct Table A.16
esttab MAorPhD BA pooled, mti se scalars(N R2) label star(ms 0.1 * 0.05 ** 0.01 *** 0.001)

drop COMPLEX AMBIGOUS 
drop _est_MAorPhD _est_BA _est_pooled

reshape wide P, i(ID) j(Source)
drop P1 P2 P3 P4




*******************************************************
* Table A17: OLS Regressions of Ellsberg Ambiguity Premium, Actuaries
*******************************************************

* Define model uncertainty attitude
generate double MU_A=P_MA0-P_CR0

* Define complexity attitude
generate double c_A=P_CR25-P_CR0

* Define reduction
generate double red=0
replace red=1 if P_CR0!=0
replace red=. if P_CR0==.

* dummy for sophistication
generate double Soph=Actuaries

* regression for Master's and PhD's
regress P_E c_A MU_A red  if Actuaries==0 & Higher_than_Bach==1, vce(robust)
estimates store MAorPhD

* regression for Bachelors'
regress P_E  c_A MU_A red  if Actuaries==0 & Higher_than_Bach==0, vce(robust)
estimates store BA

* regression for comparing two groups of students
regress P_E i.Higher_than_Bach##c.c_A i.Higher_than_Bach##c.MU_A i.Higher_than_Bach##i.red if Actuaries==0, vce(robust) 
estimates store pooled

* reconstuct Table A.17
esttab MAorPhD BA pooled, mti se scalars(N R2) label star(ms 0.1 * 0.05 ** 0.01 *** 0.001)

drop MU_A c_A red Soph

******************************************************

